package chenjiuxu.seniorui.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.ViewGroup;
/**
 * Created by 15705 on 2018/3/21.
 */

public class MyViewPager extends ViewPager {
    public MyViewPager(Context context) {
        super(context);
    }

    public MyViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int h = ((ViewGroup) getParent().getParent()).getHeight();
        super.onMeasure(widthMeasureSpec,   MeasureSpec.makeMeasureSpec(h,MeasureSpec.EXACTLY));
    }
}
